/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import translationEnglish from './english'
import translationChinese from './chinese'

const resources = {
  english: {
    translation: translationEnglish
  },
  chinese: {
    translation: translationChinese
  }
}
void i18n.use(initReactI18next).init({
  resources,
  lng: localStorage.getItem('lang') || navigator.language.slice(0, 7)
})
export default i18n
